package com.titaniume.rabbitmq.springbootrabbitmq.consumer;

import com.titaniume.rabbitmq.springbootrabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ProjectName: rabbitmq
 * @Package: com.titaniume.rabbitmq.springbootrabbitmq.consumer
 * @ClassName: Consumer
 * @Author: titan
 * @Description: 接收消息
 * @Date: 2022/1/3 16:18
 * @Version: 1.0
 */
@Component
@Slf4j
public class Consumer {

    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public  void receiveConfirmMessage(Message message){
        String msg = new String(message.getBody());
        log.info("接受到的队列confirm.queu消息：{} " ,msg);
    }
}
